﻿/*  
	------------------------------------------------------------------------
	 NQ Core Library
	
	 Homepage: http://www.awzhome.de/
	------------------------------------------------------------------------
	
	This Source Code Form is subject to the terms of the Mozilla Public
	License, v. 2.0. If a copy of the MPL was not distributed with this
	file, You can obtain one at http://mozilla.org/MPL/2.0/.
   
	The Original Code is code of NQ Core Library.

	The Initial Developer of the Original Code is Andreas Weizel.
	Portions created by the Initial Developer are
	Copyright (C) 2012 Andreas Weizel. All Rights Reserved.
	
	Contributor(s): (none)
	
	------------------------------------------------------------------------
*/

using System;

namespace AWZhome.NQ.Core
{

	/// <summary>
	/// Delegate for the
	/// <see cref="AWZhome.NQ.Core.INQServiceManager.ServiceCreated">ServiceCreated</see>
	/// event of the Service Manager.
	/// </summary>
	/// <param name="sender">Instance of the event sender.</param>
	/// <param name="e">Event information object.</param>
	public delegate void NQServiceCreatedEventHandler(object sender, NQServiceCreatedEventArgs e);

	/// <summary>
	/// Delegate for the
	/// <see cref="AWZhome.NQ.Core.INQServiceManager.ServiceDestroyed">ServiceDestroyed</see>
	/// event of the Service Manager.
	/// </summary>
	/// <param name="sender">Instance of the event sender.</param>
	/// <param name="e">Event information object.</param>
	public delegate void NQServiceDestroyedEventHandler(object sender, NQServiceDestroyedEventArgs e);
	/// <summary>
	/// Delegate for the
	/// <see cref="AWZhome.NQ.Core.INQServiceManager.MessageLogged">MessageLogged</see>
	/// event of the Service Manager.
	/// </summary>
	/// <param name="sender">Instance of the event sender.</param>
	/// <param name="e">Event information object.</param>
	public delegate void NQLogEventHandler(object sender, NQLogEventArgs e);

	/// <summary>
	/// Delegate for the thread synchronization mechanism offered by the Service Manager,
	/// intended for methods without return values.
	/// </summary>
	/// <typeparam name="P">Type of the method parameter.</typeparam>
	/// <param name="parameter">Parameter passed to the method.</param>
	/// <remarks>
	/// This delegate is used with the 
	/// <see cref="AWZhome.NQ.Core.INQServiceManager.InvokeSyncMethod">InvokeSyncMethod</see>
	/// method of the Service Manager.
	/// </remarks>
	public delegate void NQSynchronizedProcDelegate<P>(P parameter);

	/// <summary>
	/// Delegate for the thread synchronization mechanism offered by the Service Manager.
	/// </summary>
	/// <typeparam name="P">Type of the method parameter.</typeparam>
	/// <typeparam name="R">Return type of the method.</typeparam>
	/// <param name="parameter">Parameter passed to the method.</param>
	/// <returns>The return value of the method.</returns>
	/// <remarks>
	/// This delegate is used with the 
	/// <see cref="AWZhome.NQ.Core.INQServiceManager.InvokeSyncMethod">InvokeSyncMethod</see>
	/// method of the Service Manager.
	/// </remarks>
	public delegate R NQSynchronizedDelegate<P, R>(P parameter);

}